﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Entities;
using System.Data;

namespace Presentation
{
    public partial class TransferAccountReceiverExit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Response.Redirect("http://localhost:2439/MainPage.aspx");
        }
        protected void btn1_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "1";
        }

        protected void btn2_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "2";
        }

        protected void btn3_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "3";
        }

        protected void btn4_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "4";
        }

        protected void btn5_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "5";
        }

        protected void btn6_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "6";
        }

        protected void btn7_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "7";
        }

        protected void btn8_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "8";
        }

        protected void btn9_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "9";
        }

        protected void btn0_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text += "0";
        }
        protected void btnReset_Click(object sender, EventArgs e)
        {
            txtaccountexit.Text = "";
        }
        protected void btnenter_Click(object sender, EventArgs e)
        {
            AccountBLL accB = new AccountBLL();
            DataTable dt = accB.GetAllAccount();
            int tb = 0;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["AccountNo"].ToString() == txtaccountexit.Text)
                {
                    tb = 1;
                    Session.Add("AccountID2", dt.Rows[i]["AccountID"]);
                    Session.Add("CustID", dt.Rows[i]["CustID"]);
                }

            }
            if (tb == 1)
            {
                Response.Redirect("http://localhost:2439/TransferAccountReceiver.aspx");
            }
            else
            {
                Response.Redirect("http://localhost:2439/TransferAccountReceiverExit.aspx");
            }
        }
    }
}